<#include "/include/publish/macros.ftl">
<#setting number_format="#">
<@simpleheader>
    <link href="https://cdn.jsdelivr.net/npm/simplemde@1.11.2/dist/simplemde.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/github-markdown-css@2.10.0/github-markdown.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/github.min.css" rel="stylesheet">
    <style>
        .CodeMirror, .CodeMirror-scroll {
            min-height: 130px;
            max-height: 200px;
        }
        .CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word) {
            background: none;
        }
    </style>
</@simpleheader>
    <div class="clearfix"></div>
    <form id="publishForm" style="height: 100%">
                        <input type="hidden" name="id">
                        <input type="hidden" name="isMarkdown" value="1">
                        <div class="item">
                            <div class="col-md-8 col-sm-8 col-xs-8" style="width:100%">
                                <input type="text" class="form-control col-md-7 col-xs-12" name="title" id="title" required="required" placeholder="请输入标题"/>
                            </div>
                        </div>
                        <div class="item" style="height: 88%">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12" for="password">内容 <span class="required">*</span></label>
                            <div class="col-md-10 col-sm-10 col-xs-10" style="width:100%;height: 88%;">
                                <textarea class="form-control col-md-7 col-xs-12" id="content" name="content" style="display: none" required="required"></textarea>
                                <textarea class="form-control col-md-7 col-xs-12 valid" id="contentMd" name="contentMd" style="display: none" required="required"></textarea>
                            </div>
                        </div>
                        <div class="navbar-fixed-bottom" style="height:8%">
                            <label class="control-label col-md-1 col-sm-1 col-xs-12"></label>
                            <div class="col-md-10 col-sm-10 col-xs-12">
                                <button type="button" class="btn btn-success to-choose-info"><i class="fa fa-pencil"> 发布文章</i></button>
                            </div>
                        </div>
        <@userpublishmodal></@userpublishmodal>
    </form>
</div>
<@chooseImgModal></@chooseImgModal>
<@userfooter>

    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/lib/highlight.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/simplemde@1.11.2/dist/simplemde.min.js"></script>
    <script type="text/javascript" src="${config.staticWebSite}/assets/js/inline-attachment.js"></script>
    <script type="text/javascript" src="${config.staticWebSite}/assets/js/codemirror.inline-attachment.js"></script>
    <script>
        var op = {
            id: "contentMd",
            uniqueId: "mdEditor_1",
            uploadUrl: "/api/uploadFileForMd"
        };
        zhyd.simpleMDE.init(op);
        articleId = '${id}';
    </script>
    <script src="${config.staticWebSite}/assets/js/zhyd.user.publish-article.js"></script>
</@userfooter>
